package com.csun.cmny.provider.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2020-11-25 11:03
 * @Description:
 */
@Configuration
public class RestTemplateConfig {

    @Bean
    public RestTemplate myRestTemplate() {

        SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
        factory.setConnectTimeout(15000);
        factory.setReadTimeout(5000);

        return new RestTemplate(factory);
    }

}
